package day05;
import java.util.Scanner;
public class Mine {
	public String start(){
			int r ,c ,n;   
			Scanner sca=new Scanner(System.in);
			System.out.println("请输入布雷面板的行数：");
			r=sca.nextInt();                
			System.out.println("请输入布雷面板的列数：");
			c=sca.nextInt();
			System.out.println("请输入布雷的地雷数：");
			n=sca.nextInt();
			int[][] t = new int[r][c];
					int i ,j ,k=0;
					while(k<n){
							i=(int)(Math.random()*r);
							j=(int)(Math.random()*c);
							if(t[i][j]!=-1){
								  t[i][j]=-1;
								  k++;
							}
					}		
					for( i=0; i<t.length; i++){
						for( j=0; j<t[i].length; j++){
							System.out.print(t[i][j]+""+ '\t');
						}	System.out.println();
							System.out.println();
					}
				return "你赢了！";
			}	
		public static void main(String[] args) {
			Mine m = new  Mine();
			//	m.start();
				System.out.println(m.start());
	}
}